package com.hook3.pianke.activity;

import android.app.Activity;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.FrameLayout;

import com.hook3.pianke.Adapter.HomeAdapter;
import com.hook3.pianke.R;

/**
 * 首页
 * Created by HOME on 2015/12/8.
 */
public class HomeActivity {
    private Activity activity;
    private Toolbar toolbar;  //标题
    private FrameLayout frameLayout;//实现View;
    private View inflate;
    private ViewPager pvr_user_pager;


    public HomeActivity(Activity activity, Toolbar toolbar, FrameLayout frameLayout) {
        this.activity = activity;
        this.toolbar = toolbar;
        this.frameLayout = frameLayout;
        init();
    }

    /**
     * 实例化自己要实现的内容
     */
    public void init() {
        toolbar.setTitle("首页");
        inflate = View.inflate(activity, R.layout.activity_home, null);
        pvr_user_pager = (ViewPager) inflate.findViewById(R.id.pvr_user_pager);
        //三个view传进去

        FrameLayout view = new FrameLayout(activity);
        pvr_user_pager.setAdapter(new HomeAdapter(activity,view));
       frameLayout.addView(inflate);
    }


}
